package org.example.spi.java;

import org.example.common.PrintService;

import java.util.ServiceLoader;

/**
 * @author liangzj
 * @date 2021/5/23 9:58
 */
public class JavaSPIDemo {
    public static void main(String[] args) {
        ServiceLoader<PrintService> serviceServiceLoader = ServiceLoader.load(PrintService.class);

        for (PrintService printService : serviceServiceLoader) {
            printService.printInfo();
        }
    }
}
